package com.huxun.service.Impl;

import com.huxun.bean.Cart;
import com.huxun.mapper.CartMapper;
import com.huxun.service.CartService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class CartServiceImpl implements CartService {
    @Autowired
    CartMapper cartMapper;
    @Override
    public int addCart(Cart cart) {
        return cartMapper.addCart(cart);
    }

    @Override
    public int updateCart(Cart cart) {
        return cartMapper.updateCart(cart);
    }

    @Override
    public int deleteCart(int desk_id) {
        return cartMapper.deleteCart(desk_id);
    }

    @Override
    public int deleteCartById(int id) {
        return cartMapper.deleteCartById(id);
    }

    @Override
    public Cart getById(int id) {
        return cartMapper.getById(id);
    }

    @Override
    public int isExists(Map<String, Object> map) {
        return cartMapper.isExists(map);
    }

    @Override
    public Cart getMyCart(Map<String, Object> map) {
        return cartMapper.getMyCart(map);
    }

    @Override
    public List<Cart> getCarts(int desk_id) {
        return cartMapper.getCarts(desk_id);
    }
}
